pass structure as a argument in the function